package com.gwkj.zxjl_user.HttpUpload;

import android.content.Context;

import com.gwkj.zxjl_user.AccountDB.ADBService;
import com.gwkj.zxjl_user.Utils.L;

import java.util.Date;

/**
 * Created by FuJiahui on 2016/7/6.
 */
public class ULConstants {
    public static final int AVATAR = 2047;
    public static final int IDCARD = 2046;
    public static final int MYJOB = 2045;
    public static final int CASE = 2044;
    public static final int CAROSEL = 2043;
    public static final int MYTASK = 2042;

    public static UpLoadBean getBean(Context context, int key, String filepath){

        String prefix = "";
        if (key == AVATAR){
            prefix = "/avatar/";
        }else if (key == IDCARD){
            prefix = "/idcard/";
        }else if (key == MYJOB){
            prefix = "/myjob/";
        }else if (key == CASE){
            prefix = "/case/";
        }else if (key == CAROSEL){
            prefix = "/carosel/";
        }else if (key == MYTASK){
            prefix = "/mytask/";
        }

        ADBService adbService = new ADBService(context);
        int id = adbService.getID();
        long time = new Date().getTime();
        String path = prefix+ id +"/"+ time+".jpg";
        L.e("path", path);
        UpLoadBean upLoadBean = new UpLoadBean(key, filepath, path);
        return upLoadBean;
    }
}
